'use strict';
import React, {Component} from 'react';
import {
    StyleSheet,
    View,
    Text,
    Image,
    TouchableOpacity,
    ListView,
    RefreshControl,
} from 'react-native';
import Global from '../Commom/GlobalConst';
import TravelsDetails from '../Pages/TravelsDetails';
import RuralLibraryAPIService from "../Commom/RuralLibraryAPIService";
export default class HeadlineDetails extends Component {
    constructor(props) {
        super(props);
        this.state = {
            headlineData: {}
        };
    }

    componentDidMount() {
        this.setState({
            headlineData: this.props.data,
        });
    }

    BackAction() {
        this.props.navigator.pop();
    }


    render() {
        return (
            <View style={styles.container}>
                <View style={{width:Global.Const.size.width,height:65,backgroundColor:'white'}}>

                    <View style={{marginTop:24,alignItems:'center'}}>

                        <View style={{width:21,height:21,position:'absolute',left:12,top:3}}>
                            <TouchableOpacity activeOpacity={0.5}
                                              onPress={()=>this.BackAction()}>
                                <Image style={{resizeMode:'contain',width:21,height:21}}
                                       source={require('../../Image/icon_back.png')}></Image>
                            </TouchableOpacity>
                        </View>
                        <Text style={{fontSize:20,color:Global.FontColor.DimGray}}>乡村头条</Text>
                    </View>
                </View>
                <View style={{flex:1,marginTop:1,backgroundColor:'white'}}>
                    <Text
                        style={{fontSize:14,color:Global.FontColor.DimGray,paddingLeft:10,paddingRight:10,paddingTop:10}}>标题：</Text>
                    <Text
                        style={{fontSize:14,color:Global.FontColor.DimGray,paddingLeft:10,paddingRight:10,paddingTop:10}}>{'   ' + this.state.headlineData.title}</Text>
                    <Text
                        style={{fontSize:14,color:Global.FontColor.DarkGray,paddingLeft:10,paddingRight:10,paddingTop:10}}>详情：</Text>
                    <Text
                        style={{fontSize:14,color:Global.FontColor.DarkGray,padding:10}}>{'   ' + this.state.headlineData.content}</Text>

                </View>
            </View>
        );
    }
}

var styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: Global.Const.transparent,
    },
});